﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            _a = new A();
            _a.content = "gaochao";
            _b = new B(_a.content);
            result.Text = _a.content;
        }
        private A _a;
        private B _b;
        private void Button_Click(object sender, RoutedEventArgs e)
        {

            _b.MakeString();
            result.Text = _a.content;
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            result.Text = _b._ct;
        }
    }

    public class A
    {
        public string content;
    }

    public class B 
    { 
        public B(string content)
        {
            _ct = content;
        }
        public string _ct;
        public void MakeString()
        {
            _ct="sadfsadfsafdsafd";
        }
    }
}
